package demo1;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        Student[] students = new Student[3];
        students[0] = new Student("zh",23,345);
        students[1] = new Student("cf",43,3245);
        students[2] = new Student("qq",28,365);


        //以下三种称为比较器
        AgeComparator ageComparator =  new AgeComparator();
        NameComparator nameComparator = new NameComparator();
        ScoreComparator scoreComparator = new ScoreComparator();

        Arrays.sort(students,scoreComparator);

        Arrays.sort(students);

        System.out.println(Arrays.toString(students));

    }
}
